package com.cndw.kungfu.domain;

import com.cndw.kungfu.ext.TimeProcesser;

/**
 * 帮派资金记录
 * 
 * 
 * @author <a href="mailto:whz-work@163.com">汪洪州</a>
 * 
 * @since 1.0 Create on 2011-5-27
 */
public class UnionAsset {

	/**
	 * 帮派Id
	 */
	private int unionId;

	/**
	 * 玩家id
	 */
	private long playerId;

	/**
	 * 玩家名字
	 */
	private String playerName;

	/**
	 * 金额
	 */
	private int asset;
	
	/**
	 * 资源
	 */
	private int resource;

	/**
	 * 事件
	 */
	private int eventType;

	/**
	 * 1:增加，2:消耗
	 */
	private int type;
	/**
	 * 时间
	 */
	private int addTime;
	/**
	 * 消耗经验大于20 反之增加
	 */

	public static final int finishTask = 10;// 任务增加
	public static final int getCashCowReward = 11;// 领取摇钱树奖励
	public static final int donateResource = 12;// 捐献帮贡

	public static final int upgradeLevel = 20; // 升级帮派等级
	public static final int upgradeStorage = 21;// 升级仓库
	public static final int upgradeHouse = 22; // 升级厢房
	public static final int upgradeCoffers = 23; // 升级金库
	public static final int upgradeSkill = 24; // 升级帮派技能
	public static final int upgradePetLv = 28; // 升级帮派神兽等级
	public static final int openPetChallenge = 29; // 开启帮派神兽挑战

	public static UnionAsset getUnionAsset(int unionId, long playerId, String playerName, int asset, int resource, int eventType) {
		int type = 1;
		if (eventType >= 20) {
			type = 2;
		}
		UnionAsset unionAsset = new UnionAsset();
		unionAsset.setUnionId(unionId);
		unionAsset.setPlayerId(playerId);
		unionAsset.setPlayerName(playerName);
		unionAsset.setAsset(asset);
		unionAsset.setResource(resource);
		unionAsset.setAddTime(TimeProcesser.getUnixTime());
		unionAsset.setType(type);
		unionAsset.setEventType(eventType);
		return unionAsset;
	}

	public long getPlayerId() {
		return playerId;
	}

	public void setPlayerId(long playerId) {
		this.playerId = playerId;
	}

	public int getAsset() {
		return asset;
	}

	public void setAsset(int asset) {
		this.asset = asset;
	}

	public int getAddTime() {
		return addTime;
	}

	public void setAddTime(int addTime) {
		this.addTime = addTime;
	}

	public int getUnionId() {
		return unionId;
	}

	public void setUnionId(int unionId) {
		this.unionId = unionId;
	}

	public String getPlayerName() {
		return playerName;
	}

	public void setPlayerName(String playerName) {
		this.playerName = playerName;
	}

	public int getEventType() {
		return eventType;
	}

	public void setEventType(int eventType) {
		this.eventType = eventType;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public int getResource() {
		return resource;
	}

	public void setResource(int resource) {
		this.resource = resource;
	}

}
